/**
 * Aug 31, 2013 9:31:27 AM
 * com.kratonsolution.belian.security.impl.router
 * UserRouter.java
 */
package com.kratonsolution.belian.security.impl.router;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.kratonsolution.belian.security.api.service.UserService;

/**
 * @author Agung Dodi Perdana
 * @email agung.dodi.perdana@gmail.com
 * @Version Sinch 0.0.1
 */
@Component
public class UserRouter extends RouteBuilder
{    
    @Autowired
    private UserService service;
    
    @Override
    public void configure() throws Exception
    {
        from("activemq:queue:userservice.signin").transacted().process(new Processor()
        {
            
            public void process(Exchange exchange) throws Exception
            {
                System.out.println("exchange.getIn().getHeaders() ---> "+exchange.getIn().getHeaders());
                System.out.println("exchange.getIn().getBody() ---> "+exchange.getIn().getBody());
            }
        }).bean(service,"signin");
    }
}
